<template>
  <Spin :spinning="exportLoading" tip="Loading...">
    <el-tabs v-model="activeName" type="card">
      <el-tab-pane label="终端信息" name="info">
        <FormPanel ref="formPanel" :list="formList" :labelPosition="'top'" @formChange="changeHandle" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="4" />
        <FormPanel ref="formPanel1" :list="formList1" :labelPosition="'top'" @formChange="changeHandle1" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="4" />
        <FormPanel ref="formPanel2" :list="formList2" :labelPosition="'top'" @formChange="changeHandle2" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="4" />
        <FormPanel ref="formPanel3" :list="formList3" :labelPosition="'top'" @formChange="changeHandle3" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="4" />
        <!-- <FormPanel ref="formPanel4" :list="formList4" @formChange="changeHandle4" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="4" /> -->
      </el-tab-pane>
      <el-tab-pane v-if="type == 'detail'" label="变更明细" name="detailed">
        <Detail v-if="activeName == 'detailed'" :rowData="rowData"></Detail>
      </el-tab-pane>
      <!-- <el-tab-pane label="电池租赁" name="second" v-if="isShow">
        <FormPanel ref="formList7" :list="formList7" :formType="type" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="4" />
      </el-tab-pane> -->
    </el-tabs>
    <div>
      <!-- <div style="height: 47px"></div> -->
      <div
        :style="{
          position: 'fixed',
          left: 0,
          bottom: 0,
          right: 0,
          zIndex: 9,
          borderTop: '1px solid #e9e9e9',
          padding: '10px 20px',
          background: '#fff',
          textAlign: 'center',
        }"
      >
        <el-button type="primary" v-if="type != 'detail'" @click="updateAudit(1)">保存</el-button>
        <el-button @click="closeDrawer">返回</el-button>
      </div>
      <!--<BaseDialog :visible.sync="vinSelect" title="车辆选择" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">-->
      <!--<SelectVin @close="vinClose" @onConfirm="handleVehicleChoice" :dealerCode="userDealerCode"></SelectVin>-->
      <!--</BaseDialog>-->
    </div>
  </Spin>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
import { IDNumber, zipCode, ownerLicensePlate, licenseNum, phone } from '@/utils/validate';
import { getInfoById, getAllProvince, queryRegionName, queryRegionByCode, keyCustomerupdateaudit } from '@/api/omSale/ActualSales/KeyCustomerActualSales';
import Detail from './detail';

export default {
  mixins: [dictionary],
  // props: ['type', 'rowData', ],

  props: {
    type: {
      type: String,
      default: 'detail',
    },
    rowData: {
      type: Object,
      required: true,
    },
  },
  data() {
    this.saveData = null;
    this.saveData1 = null;
    this.saveData2 = null;
    this.saveData3 = null;
    // this.saveData4 = null;
    return {
      formList: this.createdFrom(),
      formList1: this.createdFrom1(),
      formList2: this.createdFrom2(),
      formList3: this.createdFrom3(),
      // formList4: this.createdFrom4(),
      formList5: this.createdFrom5(),
      formList6: this.createdFrom6(),
      formList7: this.createdFrom7(),
      columns: this.createdTable(),
      dataSource: [],
      exportLoading: false,
      isCan: false,
      // isShow: false,
      empList: [],
      carInfo: {},
      customerInfo: {},
      salesReportInfo: {},
      vinSelect: false,
      userDealerCode: '',
      addData: {},
      res: {},
      ttVsSolidAuditAccessoryPOS: [],
      activeName: 'info',
      detailData: {},
    };
  },
  components: { Detail },
  created() {
    this.initProvince();
    this.licensePlateinitProvince();
  },
  mounted() {
    console.log(this.type);
    this.init();
    if (this.type == 'detail') {
      console.log(this.formList);
      this.formList.forEach((item) => {
        item.disabled = true;
      });
      this.formList1.forEach((item) => {
        item.disabled = true;
        if (item.fieldName == 'customerName') {
          item.rules = [{ required: true, message: '请选择', trigger: 'blur' }];
        }
      });
      console.log('表单');
      console.log(this.formList1);
      this.formList2.forEach((item) => {
        item.disabled = true;
      });
      this.formList3.forEach((item) => {
        item.disabled = true;
        if (item.fieldName == 'vehiclePossessor') {
          item.rules = [{ required: true, message: '请选择', trigger: 'blur' }];
        }
      });
      // this.formList4.forEach(item => {
      //   item.disabled = true;
      // });
      if (this.type === 'detail') {
        this.formList.forEach((item) => {
          item.rules = [];
        });
        this.formList1.forEach((item) => {
          item.rules = [];
        });
        this.formList2.forEach((item) => {
          item.rules = [];
        });
        this.formList3.forEach((item) => {
          item.rules = [];
        });
      }
    }
  },
  methods: {
    init() {
      this.detailData = { actualSalesId: this.rowData.actualSalesId, solidType: this.rowData.solidType };
      this.getDetail();
    },

    async updateAudit() {
      let statusParams = {};
      let [err, data] = await this.$refs.formPanel.GET_FORM_DATA();
      let [err1, data1] = await this.$refs.formPanel1.GET_FORM_DATA();
      let [err2, data2] = await this.$refs.formPanel2.GET_FORM_DATA();
      let [err3, data3] = await this.$refs.formPanel3.GET_FORM_DATA();
      // let [err4, data4] = await this.$refs.formPanel4.GET_FORM_DATA();
      if (err || err1 || err2 || err3) {
        this.exportLoading = false;
        return;
      }
      statusParams = {
        ...this.rowData,
        ...this.addData,
        ...data,
        ...data1,
        ...data2,
        ...data3,
        // ...data4
      };
      statusParams.directivePrice = Number(statusParams.directivePrice);

      const arr = Object.keys(statusParams);

      const filterUrl = arr.filter((item) => statusParams[item] && statusParams[item].length > 0 && statusParams[item][0].url);
      filterUrl.forEach((item) => {
        statusParams[item].forEach((val) => {
          const str = val.url;
          const index = str.indexOf('.com/');
          if (index > 0) {
            const result = str.substr(index + 5, str.length);
            val.url = result;
          }
        });
      });
      if (statusParams.fileUrl && statusParams.fileUrl.length > 0) {
        statusParams.fileUrl = statusParams.fileUrl[0].url;
      } else {
        statusParams.fileUrl = '';
      }
      // 查找地区名
      statusParams.provinceName = this.formList1.find((item) => item.fieldName === 'provinceCode').itemList.filter((item) => item.value === statusParams.provinceCode)[0].text;
      statusParams.cityName = this.formList1.find((item) => item.fieldName === 'cityCode').itemList.filter((item) => item.value === statusParams.cityCode)[0].text;
      const districtCode = this.formList1.find((item) => item.fieldName === 'districtCode').itemList.filter((item) => item.value === statusParams.districtCode);
      statusParams.districtName = districtCode.length > 0 ? districtCode[0].text : '';


      const licensePlateProvinceCode = this.formList3.find((item) => item.fieldName === 'licensePlateProvinceCode').itemList.filter((item) => item.value === statusParams.licensePlateProvinceCode);
      statusParams.licensePlateProvinceName = licensePlateProvinceCode.length > 0 ? licensePlateProvinceCode[0].text : '';
      // statusParams.licensePlateProvinceName = this.formList3.find((item) => item.fieldName === 'licensePlateProvinceCode').itemList.filter((item) => item.value === statusParams.licensePlateProvinceCode)[0].text;
      const licensePlateCityCode = this.formList3.find((item) => item.fieldName === 'licensePlateCityCode').itemList.filter((item) => item.value === statusParams.licensePlateCityCode);
      statusParams.licensePlateCityName = licensePlateCityCode.length > 0 ? licensePlateCityCode[0].text : '';

      // statusParams.licensePlateCityName = this.formList3.find((item) => item.fieldName === 'licensePlateCityCode').itemList.filter((item) => item.value === statusParams.licensePlateCityCode)[0].text;
      if (statusParams.birthday) {
        if (!(statusParams.birthday.length > 10)) {
          statusParams.birthday += ' 00:00:00';
        }
      }
      if (statusParams.licensePlateDate) {
        if (!(statusParams.licensePlateDate.length > 10)) {
          statusParams.licensePlateDate += ' 00:00:00';
        }
      }
      if (statusParams.vehicleLicenseIssueDate) {
        if (!(statusParams.vehicleLicenseIssueDate.length > 10)) {
          statusParams.vehicleLicenseIssueDate += ' 00:00:00';
        }
      }
      if (statusParams.vehicleLicenseDate) {
        if (!(statusParams.vehicleLicenseDate.length > 10)) {
          statusParams.vehicleLicenseDate += ' 00:00:00';
        }
      }
      if (statusParams.isVip !== 10041001) {
        statusParams.bigCustomerFiles = [];
      }
      let res = null;
      this.$confirm('是否提报?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(async () => {
          this.exportLoading = true;
          if (this.isAdd) {
            res = await keyCustomerupdateaudit(statusParams);
          } else {
            res = await keyCustomerupdateaudit(statusParams);
          }
          if (res.resultCode == 200) {
            this.closeDrawer();
          }
          this.exportLoading = false;
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消',
          });
        });
    },
    // 详细
    async getDetail() {
      this.exportLoading = true;
      const res = await getInfoById(this.rowData.actualSalesId, this.rowData.solidType);
      if (res.resultCode == 200) {
        // if (res.data.isBatteryRental == 10041001) {
        //   this.isShow = true;
        // }
        this.addData = { ...this.addData, ...res.data };
        await this.initCity(res.data.provinceCode);
        await this.initRegion(res.data.cityCode);
        await this.licensePlateinitCity(res.data.licensePlateProvinceCode);
        for (let i in res.data) {
          this.formList.map((x) => {
            if (x.fieldName == i && res.data[i]) {
              x.initialValue = res.data[i];
              if (x.fieldName === 'powerType') {
                this.selectPowerType(res.data[i]);
              }
            }
          });
          this.formList1.map((x) => {
            if (x.fieldName == i) {
              x.initialValue = res.data[i];
              if (x.fieldName === 'customerType') {
                this.selectCustomer(res.data[i]);
              }
              if (x.fieldName === 'isVip') {
                this.isSelectVip(res.data[i]);
              }
              if (x.fieldName === 'idTypeCode') {
                this.changIdCard(res.data[i]);
              }
            }
          });
          this.formList2.map((x) => {
            if (x.fieldName == i) {
              x.initialValue = res.data[i];
              if (x.fieldName === 'isRebate') {
                this.isSelectRebate(res.data[i]);
              }
              if (x.fieldName === 'isReplace') {
                this.isSelectReplace(res.data[i]);
              }
            }
          });
          this.formList3.map((x) => {
            if (x.fieldName == i) {
              x.initialValue = res.data[i];
            }
          });
          this.formList7.map((x) => {
            if (x.fieldName == i) {
              x.initialValue = res.data[i];
            }
          });
          // this.formList4.map(x => {
          //   if (x.fieldName == i) {
          //     x.initialValue = res.data[i];
          //   }
          // });
        }
      }
      this.exportLoading = false;
      return res.data;
    },
    changeHandle(val) {
      console.log('zhx');

      this.saveData = val;
    },
    changeHandle1(val) {
      console.log('zhx');

      this.saveData1 = val;
    },
    changeHandle2(val) {
      console.log('zhx');

      this.saveData2 = val;
    },
    changeHandle3(val) {
      console.log('zhx');

      this.saveData3 = val;
    },
    // changeHandle4(val) {
    //   console.log('zhx');
    //   this.saveData4 = val;
    // },
    pushURL(item) {
      if (item.annexName) {
        item.data.push({
          name: item.annexName,
          uid: item.annexUid,
          url: item.annexUrl,
        });
      }
    },
    getBirthday(psidno) {
      let birthdayno, birthdaytemp;
      if (psidno.length == 18) {
        birthdayno = psidno.substring(6, 14);
      } else if (psidno.length == 15) {
        birthdaytemp = psidno.substring(6, 12);
        birthdayno = '19' + birthdaytemp;
      } else {
        return '';
      }
      const birthday = birthdayno.substring(0, 4) + '-' + birthdayno.substring(4, 6) + '-' + birthdayno.substring(6, 8);
      return birthday;
    },
    // 客户类型选择
    selectCustomer(val) {
      // 公司
      console.log(val);
      if (val === 21171002) {
        if (!this.isDetailed) {
          this.formList1.forEach((x) => {
            if (
              x.fieldName == 'birthday' ||
              x.fieldName == 'ageStage' ||
              x.fieldName == 'wechatNo' ||
              x.fieldName == 'identityCardFront' ||
              x.fieldName == 'identityCardReverse' ||
              x.fieldName == 'occupationType' ||
              x.fieldName == 'educationLevel' ||
              x.fieldName == 'householdType' ||
              x.fieldName == 'unitNature' ||
              x.fieldName == 'industryType' ||
              x.fieldName == 'maritalStatus' ||
              x.fieldName == 'annualHouseholdIncome' ||
              x.fieldName == 'hobby' ||
              x.fieldName == 'favoriteContactType' ||
              x.fieldName == 'convenientTime'
            ) {
              x.disabled = true;
            }
          });
        }
        this.formList1.forEach((item) => {
          // item.hidden?!item.hidden:item.hidden
          if (item.hidden && item.fieldName !== 'bigCustomerFiles') {
            item.hidden = false;
          }
        });
        this.formList1.find((x) => x.fieldName == 'sex').rules = [];
        this.formList1.find((x) => x.fieldName == 'idTypeCode').rules = [];
        this.formList1.find((x) => x.fieldName == 'idNumber').rules = [];
        this.formList1.find((x) => x.fieldName == 'identityCardFront').rules = [];
        this.formList1.find((x) => x.fieldName == 'identityCardReverse').rules = [];
        this.formList1.find((x) => x.fieldName == 'sex').disabled = true;
        this.formList1.find((x) => x.fieldName == 'idTypeCode').disabled = true;
        this.formList1.find((x) => x.fieldName == 'idNumber').disabled = true;
        if (this.type !== 'detail') {
          // this.formList1.find(x => x.fieldName == 'soNo').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          // this.formList1.find(x => x.fieldName == 'customerType').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          this.formList1.find((x) => x.fieldName == 'legalIdentityCardFront').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList1.find((x) => x.fieldName == 'legalIdentityCardReverse').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList1.find((x) => x.fieldName == 'businessLicense').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList1.find((x) => x.fieldName == 'adminAuthorizationFiles').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList1.find((x) => x.fieldName == 'unitContactPersonCardFront').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList1.find((x) => x.fieldName == 'unitContactPersonCardReverse').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList2.find(x => x.fieldName == 'consultantName').rules = [{ required: true, message: '请输入', trigger: 'change' }];
          // this.formList2.find(x => x.fieldName == 'orderAllAmount').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          // this.formList2.find(x => x.fieldName == 'handoverCarTime').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          this.formList2.find((x) => x.fieldName == 'proceduralContract').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'holdIdentityCard').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'isSpecialOrder').rules = [{ required: true, message: '请选择', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'isThreeGuarantees').rules = [{ required: true, message: '请选择', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'buildChargingPiles').rules = [{ required: true, message: '请选择', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'commercialInsuranceFiles').rules = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'trafficlInsuranceFiles').rules = [{ required: true, message: '请上传', trigger: 'change' }];
        }
        this.formList1.find((x) => x.fieldName == 'isVip').rules = [];

        // this.formList1.find(x => x.fieldName == 'identityCardReverse').disabled = false;
        // 公司只能选择 统一社会信用代码和组织机构代码
        const itemList = this.formList1.find((x) => x.fieldName == 'idTypeCode').itemList;
        this.formList1.find((x) => x.fieldName == 'idTypeCode').itemList = itemList.filter((item) => item.value == 21201008 || item.value == 21201007);
      } else {
        if (this.type !== 'detail') {
          this.formList1.find((x) => x.fieldName == 'sex').rules = [{ required: true, message: '请选择性别', trigger: 'change' }];
          this.formList1.find((x) => x.fieldName == 'idTypeCode').rules = [{ required: true, message: '请选择', trigger: 'change' }];
          if (this.formList1.find((x) => x.fieldName == 'idTypeCode').initialValue == 21201001) {
            this.formList1.find((x) => x.fieldName == 'idNumber').rules = [
              { required: true, message: '请输入', trigger: 'blur' },
              { required: true, message: '请输入正确的身份证号', validator: IDNumber, trigger: 'blur' },
            ];
          } else {
            this.formList1.find((x) => x.fieldName == 'idNumber').rules = [{ required: true, message: '请输入', trigger: 'change' }];
          }
          this.formList1.find((x) => x.fieldName == 'identityCardFront').rules = [{ required: false, message: '请上传', trigger: 'change' }];
          this.formList1.find((x) => x.fieldName == 'identityCardReverse').rules = [{ required: false, message: '请选择.', trigger: 'change' }];
          let arr = [{ required: true, message: '请上传', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'proceduralContract').rules = arr;
          this.formList2.find((x) => x.fieldName == 'holdIdentityCard').rules = arr;
          // this.formList1.find(x => x.fieldName == 'soNo').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          // this.formList1.find(x => x.fieldName == 'customerType').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          this.formList2.find(x => x.fieldName == 'consultantName').rules = [{ required: true, message: '请输入', trigger: 'change' }];
          // this.formList2.find(x => x.fieldName == 'orderAllAmount').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          // this.formList2.find(x => x.fieldName == 'handoverCarTime').rules = [{ required: true, message: '请输入', trigger: 'blur' }];
          this.formList2.find((x) => x.fieldName == 'isSpecialOrder').rules = [{ required: true, message: '请选择', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'isThreeGuarantees').rules = [{ required: true, message: '请选择', trigger: 'change' }];
          this.formList2.find((x) => x.fieldName == 'buildChargingPiles').rules = [{ required: true, message: '请选择', trigger: 'change' }];
        }

        this.formList1.find((x) => x.fieldName == 'companyName').hidden = true;
        this.formList1.find((x) => x.fieldName == 'adminAuthorizationFiles').hidden = true;
        this.formList1.find((x) => x.fieldName == 'unitContactPersonCardFront').hidden = true;
        this.formList1.find((x) => x.fieldName == 'unitContactPersonCardReverse').hidden = true;
        this.formList1.find((x) => x.fieldName == 'unitContactPersonId').hidden = true;
        this.formList1.find((x) => x.fieldName == 'lagalPersonId').hidden = true;
        this.formList1.find((x) => x.fieldName == 'lagalPersonName').hidden = true;
        this.formList1.find((x) => x.fieldName == 'fax').hidden = true;
        this.formList1.find((x) => x.fieldName == 'lagalPersonMobile').hidden = true;
        this.formList1.find((x) => x.fieldName == 'legalIdentityCardFront').hidden = true;
        this.formList1.find((x) => x.fieldName == 'legalIdentityCardReverse').hidden = true;
        this.formList1.find((x) => x.fieldName == 'businessLicense').hidden = true;
        this.formList1.find((x) => x.fieldName == 'institutionCode').hidden = true;
        this.formList1.find((x) => x.fieldName == 'unitContactMobile').hidden = true;
        this.formList1.find((x) => x.fieldName == 'unitContactor').hidden = true;

        if (this.type != 'detail') {
          this.formList1.forEach((x) => {
            if (
              x.fieldName == 'birthday' ||
              x.fieldName == 'ageStage' ||
              x.fieldName == 'wechatNo' ||
              x.fieldName == 'identityCardFront' ||
              x.fieldName == 'identityCardReverse' ||
              x.fieldName == 'occupationType' ||
              x.fieldName == 'educationLevel' ||
              x.fieldName == 'householdType' ||
              x.fieldName == 'unitNature' ||
              x.fieldName == 'industryType' ||
              x.fieldName == 'maritalStatus' ||
              x.fieldName == 'annualHouseholdIncome' ||
              x.fieldName == 'hobby' ||
              x.fieldName == 'favoriteContactType' ||
              x.fieldName == 'convenientTime' ||
              x.fieldName == 'sex' ||
              x.fieldName == 'idTypeCode' ||
              x.fieldName == 'idNumber'
            ) {
              x.disabled = false;
            }
          });
        }
        // this.formList1.find(x => x.fieldName == 'sex').hidden = true;

        //  个人不允许选择统一社会信用编码和机构代码
        const itemList = this.formList1.find((x) => x.fieldName == 'idTypeCode').itemList;
        this.formList1.find((x) => x.fieldName == 'idTypeCode').itemList = itemList.filter((item) => !(item.value == 21201007 || item.value == 21201008));
        // let arr = [];
      }
    },

    // 是否是大客户
    isSelectVip(val) {
      if (val) {
        this.formList1.find((x) => x.fieldName == 'isVip').initialValue = val;
        if (val == 10041001) {
          this.formList1.find((x) => x.fieldName == 'bigCustomerFiles').hidden = false;
        } else {
          // this.formList1.find(x => x.fieldName == 'bigCustomerFiles').rules= [];
          this.formList1.find((x) => x.fieldName == 'bigCustomerFiles').hidden = true;
        }
        console.log(this.formList1.find((x) => x.fieldName == 'bigCustomerFiles'));
        this.$forceUpdate();
      }
    },
    // 是否是燃油车
    selectPowerType(val) {
      let arr = [];
      let notArr = [{ required: true, message: '请选择', trigger: 'change' }];
      if (val == 50081001) {
        arr = [{ required: false, message: '请选择', trigger: 'change' }];
        notArr = [];
      }
      // 燃油车必传
      // this.formList2.find(x => x.fieldName == 'isBatteryRental').rules = arr;
      // this.formList2.find(x => x.fieldName == 'proceduralContract').rules = arr;
      // // 电车必传
      if (this.type !== 'detail') {
        this.formList2.find((x) => x.fieldName == 'isBatteryRental').rules = notArr;
      }
    },

    isSelectRebate(val) {
      let arr = [];
      let hobby = true;
      this.formList2.find((x) => x.fieldName == 'isRebate').initialValue = val;
      if (val == 10041001) {
        // arr = [{ required: true, message: '请上传', trigger: 'change' }];
        this.formList2.find((x) => x.fieldName == 'rebateFiles').hidden = false;
      } else {
        this.formList2.find((x) => x.fieldName == 'rebateFiles').hidden = true;
      }
      // this.formList2.find(x => x.fieldName == 'rebateFiles').rules = arr;
      this.$forceUpdate();
      console.log('返利' + val);
      console.log(this.formList2.find((x) => x.fieldName == 'rebateFiles'));
    },
    isSelectReplace(val) {
      let arr = [];
      this.formList2.find((x) => x.fieldName == 'isReplace').initialValue = val;
      if (val == 10041001) {
        // arr = [{ required: true, message: '请上传', trigger: 'change' }];
        this.formList2.find((x) => x.fieldName == 'replaceFiles').hidden = false;
      } else {
        this.formList2.find((x) => x.fieldName == 'replaceFiles').hidden = true;
      }
      // this.formList2.find(x => x.fieldName == 'replaceFiles').rules = arr;
      this.$forceUpdate();
      console.log('换购' + val);
      console.log(this.formList2.find((x) => x.fieldName == 'replaceFiles'));
    },
    changIdCard(val) {
      const customerTypeVal = this.formList1.find((x) => x.fieldName == 'customerType').initialValue || '';
      if (customerTypeVal === 21171001) {
        if (this.type !== 'detail') {
          if (val == 21201001) {
            this.formList1.find((x) => x.fieldName == 'idNumber').rules = [
              { required: true, message: '请输入', trigger: 'blur' },
              { required: true, message: '请输入正确的身份证号', validator: IDNumber, trigger: 'blur' },
            ];
          } else {
            this.formList1.find((x) => x.fieldName == 'idNumber').rules = [{ required: true, message: '请输入', trigger: 'change' }];
          }
        } else {
          this.formList1.find((x) => x.fieldName == 'idNumber').rules = [];
        }
      }
    },
    // 证件号
    changeIdNumber(val) {
      console.log(
        this.formList1.find((x) => x.fieldName == 'idNumber'),
        val.length
      );
      if (this.formList1.find((x) => x.fieldName == 'idTypeCode').initialValue == 21201001 && val.length >= 15) {
        const birthday = this.getBirthday(val);
        console.log(
          this.formList1.find((x) => x.fieldName == 'birthday'),
          birthday
        );
        if (birthday) {
          this.formList1.find((x) => x.fieldName == 'birthday').initialValue = birthday;
        }
      }
    },
    changeUpload(val) {
      console.log('45678');
      if (!(val && val.length > 0)) return;
      console.log(val);
      val.forEach((item) => {
        const str = item.url.split(item.name);
        if (str.length > 1) {
          item.name += str[1];
        }
      });
      console.log(val);
    },

    closeDrawer() {
      this.$emit('close', false);
    },
    clearFormItem(item) {
      item.initialValue = undefined;
      item.itemList = [];
    },
    //初始化所在省份
    async initProvince() {
      const res = await getAllProvince();
      console.log(res);
      this.formList1.find((item) => item.fieldName === 'provinceCode').itemList = res.data.map((x) => ({ value: x.regionCode, text: x.regionName }));
    },
    async licensePlateinitProvince() {
      const res = await getAllProvince();
      console.log(res);
      this.formList3.find((item) => item.fieldName === 'licensePlateProvinceCode').itemList = res.data.map((x) => ({ value: x.regionCode, text: x.regionName }));
    },
    //初始化所在市数据
    async initCity(regionId) {
      const cityCode = this.formList1.find((x) => x.fieldName === 'cityCode') || [];
      console.log('城市', cityCode);
      if (cityCode) {
        this.clearFormItem(cityCode);
      }
      const districtCode = this.formList1.find((x) => x.fieldName === 'districtCode') || [];
      if (districtCode) {
        this.clearFormItem(districtCode);
      }
      console.log(regionId);
      if (!regionId) return;
      const res = await queryRegionName(regionId);
      console.log(res);
      this.formList1.find((item) => item.fieldName === 'cityCode').itemList = res.data.map((x) => ({ value: x.regionCode, text: x.regionName }));
    },
    async licensePlateinitCity(regionId) {
      const licensePlateCityCode = this.formList3.find((x) => x.fieldName === 'licensePlateCityCode') || [];
      if (licensePlateCityCode) {
        this.clearFormItem(licensePlateCityCode);
      }
      // const districtCode = this.formList3.find(x => x.fieldName === 'districtCode') || [];
      // if (districtCode) {
      //   this.clearFormItem(this.formList3.find(x => x.fieldName === 'districtCode'));
      // }
      if (!regionId) return;
      const res = await queryRegionName(regionId);
      console.log(res);
      this.formList3.find((item) => item.fieldName === 'licensePlateCityCode').itemList = res.data.map((x) => ({ value: x.regionCode, text: x.regionName }));
    },

    async initRegion(regionId) {
      // this.clearFormItem(this.formList1.find(item => item.fieldName === 'cityName'));
      this.clearFormItem(this.formList1.find((x) => x.fieldName === 'districtCode'));
      console.log(regionId);
      if (!regionId) return;
      const res = await queryRegionName(regionId);
      console.log(res);
      this.formList1.find((item) => item.fieldName === 'districtCode').itemList = res.data.map((x) => ({ value: x.regionCode, text: x.regionName }));
    },
    // 翻译省市区
    transDictText(val, dirtArr) {
      console.log(dirtArr, '---翻译---');
      let res = '';
      if (!val) return res;
      if (Array.isArray(dirtArr)) {
        const target = dirtArr.find((x) => x.value == val);
        res = target ? target.text || '' : val;
      }
      return res;
    },
    // vin选择
    selectVin() {
      this.vinSelect = true;
    },
    // 关闭
    vinClose() {
      this.vinSelect = false;
    },
    // ---------------------------车辆信息---------------------------
    createdFrom() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '车辆信息',
        },
        {
          type: 'INPUT',
          label: '品牌',
          fieldName: 'brandName',
          initialValue: '',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '车系',
          fieldName: 'seriesName',
          initialValue: '',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '车型',
          fieldName: 'modelName',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '配置',
          fieldName: 'configName',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '年款',
          fieldName: 'yearModel',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '选装',
          fieldName: 'optionName',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '内饰',
          fieldName: 'trimName',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '外饰',
          fieldName: 'colorName',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '物料编码',
          fieldName: 'productCode',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '物料描述',
          fieldName: 'productName',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'SELECT',
          label: '动力类型',
          fieldName: 'powerType',
          disabled: true,
          placeholder: '',
          itemList: this.createDictList('5008'),
          change: (val) => {
            this.selectPowerType(val);
          },
        },
        {
          type: 'INPUT',
          label: '销售指导价',
          fieldName: 'directivePrice',
          placeholder: '',
          disabled: true,
          numberFormat: true,
          precision: 2,
        },
        {
          type: 'INPUT',
          label: 'VIN',
          fieldName: 'vin',
          initialValue: '',
          disabled: true,
          readonly: true,
          placeholder: '请输入VIN...',
          rules: [{ required: true, message: '请输入VIN...', trigger: 'blur' }],
          unitRender: (p) => {
            return (
              <div>
                <multiuse-button icon="el-icon-search" onClick={() => this.selectVin()} />
              </div>
            );
          },
        },
        {
          type: 'INPUT',
          label: '发动机号',
          fieldName: 'engineNo',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '电机号',
          fieldName: 'eleEngineNo',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '合格证号',
          fieldName: 'certificateNumber',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '电池号',
          fieldName: 'batteryNo',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'DATE',
          label: '终端配车日期',
          maxDateTime: new Date(),
          fieldName: 'dispatchedData',
          dateType: 'exactdate',
          format: 'yyyy-MM-dd HH:mm:ss',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '公告号',
          fieldName: 'announcementNo',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '经销商名称',
          fieldName: 'dealerName',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'DATE',
          label: '终端出库日期',
          maxDateTime: new Date(),
          fieldName: 'latestStockOutDate',
          dateType: 'exactdate',
          format: 'yyyy-MM-dd HH:mm:ss',
          placeholder: '',
          disabled: true,
        },
      ];
    },
    // ----------------------------客户信息--------------------------
    createdFrom1() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '客户信息',
        },
        {
          type: 'INPUT',
          label: '零售单号',
          fieldName: 'soNo',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '客户编号',
          fieldName: 'potentialCustomerNo',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '客户姓名',
          fieldName: 'customerName',
          maxlength: 36,
          disabled: true,
          rules: [],
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '客户类型',
          fieldName: 'customerType',
          placeholder: '',
          disabled: true,
          itemList: this.createDictList('2117') || [],
          change: (val) => {
            this.selectCustomer(val);
          },
        },
        {
          type: 'SELECT',
          label: '性别',
          fieldName: 'sex',
          placeholder: '',
          rules: [{ required: true, message: '请选择', trigger: 'change' }],
          itemList: this.createDictList('1002') || [],
        },
        {
          type: 'SELECT',
          label: '证件类型',
          fieldName: 'idTypeCode',
          rules: [{ required: true, message: '请选择', trigger: 'change' }],
          placeholder: '',
          itemList: this.createDictList('2120') || [],
          change: (val) => {
            this.changIdCard(val);
          },
        },
        {
          type: 'INPUT',
          label: '证件号',
          fieldName: 'idNumber',
          rules: [],
          placeholder: '',
          maxlength: 36,
          change: (val) => {
            this.changeIdNumber(val);
          },
        },
        {
          type: 'DATE',
          label: '出生日期',
          maxDateTime: new Date(),
          fieldName: 'birthday',
          disabled: true,
          dateType: 'exactdate',
          disabled: true,
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '年龄段',
          fieldName: 'ageStage',
          disabled: true,
          placeholder: '',
          itemList: this.createDictList('2118') || [],
        },
        {
          type: 'INPUT',
          label: '手机号',
          fieldName: 'customerMobile',
          disabled: true,
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '电话',
          maxlength: 36,
          fieldName: 'customerPhone',
          rules: [],
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '微信号',
          maxlength: 36,
          rules: [],
          fieldName: 'wechatNo',
          disabled: true,
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '联系地址',
          rules: [{ required: true, message: '请输入', trigger: 'change' }],
          maxlength: 36,
          fieldName: 'address',
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '省份',
          rules: [{ required: true, message: '请选择', trigger: 'change' }],
          fieldName: 'provinceCode',
          initialValue: '',
          style: { width: '150px' },
          itemList: [],
          change: (val) => {
            this.initCity(val);
          },
        },
        {
          type: 'SELECT',
          label: '城市',
          rules: [{ required: true, message: '请选择', trigger: 'change' }],
          fieldName: 'cityCode',
          style: { width: '150px' },
          initialValue: '',
          itemList: [],
          change: (val) => {
            this.initRegion(val);
          },
        },
        {
          type: 'SELECT',
          label: '县区',
          // rules: [{ required: true, message: '请选择', trigger: 'change' }],
          fieldName: 'districtCode',
          style: { width: '150px' },
          placeholder: '',
          initialValue: '',
          itemList: [],
        },
        {
          type: 'INPUT',
          label: '统一社会信用代码',
          maxlength: 36,
          disabled: true,
          fieldName: 'institutionCode',
          // rules: [{ required: true, message: '请输入', trigger: 'blur' }],
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '运营单位联系人',
          maxlength: 36,
          fieldName: 'unitContactor',
          rules: [{ required: true, message: '请输入', trigger: 'blur' }],
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '运营单位联系电话',
          maxlength: 36,
          fieldName: 'unitContactMobile',
          rules: [
            { required: true, message: '请输入', trigger: 'blur' },
            { message: '请输入正确的手机号', validator: phone, trigger: 'blur' },
          ],
          placeholder: '',
        },
        {
          type: 'INPUT',
          maxlength: 36,
          label: '企业',
          fieldName: 'companyName',
          rules: [{ required: true, message: '请输入', trigger: 'blur' }],
          placeholder: '',
        },
        {
          type: 'INPUT',
          maxlength: 36,
          label: '授权人身份证号',
          fieldName: 'unitContactPersonId',
          rules: [
            { required: true, message: '请输入', trigger: 'blur' },
            { required: true, message: '请输入正确的身份证号', validator: IDNumber, trigger: 'blur' },
          ],
          placeholder: '',
        },
        {
          type: 'INPUT',
          maxlength: 36,
          label: '法人身份证号',
          fieldName: 'lagalPersonId',
          rules: [
            { required: true, message: '请输入', trigger: 'blur' },
            { required: true, message: '请输入正确的身份证号', validator: IDNumber, trigger: 'blur' },
          ],
          placeholder: '',
        },
        {
          type: 'INPUT',
          maxlength: 36,
          label: '法人代表姓名',
          rules: [],
          fieldName: 'lagalPersonName',
          placeholder: '',
        },
        {
          type: 'INPUT',
          maxlength: 36,
          label: '法人代表手机',
          rules: [],
          fieldName: 'lagalPersonMobile',
          placeholder: '',
        },

        {
          type: 'INPUT',
          maxlength: 36,
          label: '传真',
          // rules: [{ required: true, message: '请输入', trigger: 'blur' }],
          fieldName: 'fax',
          placeholder: '',
        },
        {
          type: 'INPUT',
          maxlength: 36,
          label: '邮编',
          rules: [{ message: '请输入正确的邮编', validator: zipCode, trigger: 'blur' }],
          fieldName: 'zipCode',
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '是否大客户',
          fieldName: 'isVip',
          placeholder: '',
          rules: [{ required: true, message: '请选择 ', trigger: 'change' }],
          itemList: this.createDictList('1004') || [],
          change: (val) => {
            this.isSelectVip(val);
          },
        },
        {
          type: 'INPUT',
          label: '使用人',
          maxlength: 36,
          rules: [{ required: true, message: '请输入', trigger: 'change' }],
          fieldName: 'user',
          placeholder: '',
        },
        {
          type: 'INPUT',
          maxlength: 36,
          label: '使用人电话',
          rules: [{ required: true, message: '请输入', trigger: 'change' }],
          fieldName: 'userMobile',
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '职业',
          fieldName: 'occupationType',
          placeholder: '',
          disabled: true,
          itemList: this.createDictList('2122') || [],
        },
        {
          type: 'SELECT',
          label: '学历',
          disabled: true,
          fieldName: 'educationLevel',
          placeholder: '',
          itemList: this.createDictList('1035') || [],
        },
        {
          type: 'SELECT',
          label: '户口类型',
          fieldName: 'householdType',
          placeholder: '',
          disabled: true,
          itemList: this.createDictList('2121') || [],
        },
        {
          type: 'SELECT',
          label: '单位性质',
          disabled: true,
          fieldName: 'unitNature',
          placeholder: '',
          itemList: this.createDictList('2123') || [],
        },
        {
          type: 'SELECT',
          label: '行业类型',
          fieldName: 'industryType',
          placeholder: '',
          disabled: true,
          itemList: this.createDictList('2124') || [],
        },
        // {
        //   type: 'SELECT',
        //   label: '客户级别',
        //   rules: [{ required: true, message: '请选择', trigger: 'change' }],
        //   fieldName: 'intentLevel',
        //   placeholder: '',
        //   itemList: this.createDictList('2129') || []
        // },
        {
          type: 'SELECT',
          label: '婚姻状况',
          fieldName: 'maritalStatus',
          placeholder: '',
          disabled: true,
          itemList: this.createDictList('2125') || [],
        },
        {
          type: 'SELECT',
          label: '家庭年收入',
          fieldName: 'annualHouseholdIncome',
          placeholder: '',
          disabled: true,
          itemList: this.createDictList('2126') || [],
        },
        {
          type: 'SELECT',
          label: '兴趣爱好',
          fieldName: 'hobby',
          disabled: true,
          placeholder: '',
          itemList: this.createDictList('2129') || [],
        },
        {
          type: 'SELECT',
          label: '习惯联系方式',
          fieldName: 'favoriteContactType',
          placeholder: '',
          disabled: true,
          itemList: this.createDictList('2131') || [],
        },
        {
          type: 'SELECT',
          label: '方便联系时段',
          fieldName: 'convenientTime',
          placeholder: '请选择',
          disabled: true,
          itemList: this.createDictList('2128') || [],
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证正面',
          fieldName: 'identityCardFront',
          selfCols: 2,
          // rules: [{ required: false, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          disabled: true,
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证反面',
          selfCols: 2,
          fieldName: 'identityCardReverse',
          // rules: [{ required: false, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          disabled: true,
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '法人身份证正面',
          selfCols: 2,
          fieldName: 'legalIdentityCardFront',
          // rules: [{ required: false, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '法人身份证反面',
          // rules: [{ required: false, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          fieldName: 'legalIdentityCardReverse',
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '营业执照',
          fieldName: 'businessLicense',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '管理员授权文件',
          fieldName: 'adminAuthorizationFiles',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证正面',
          fieldName: 'unitContactPersonCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证反面',
          fieldName: 'unitContactPersonCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '大客户附件',
          fieldName: 'bigCustomerFiles',
          hidden: true,
          rules: [{ required: false, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
      ];
    },
    // ----------------------------销售信息--------------------------
    createdFrom2() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '销售信息',
        },
        {
          type: 'SELECT',
          label: '购车用途',
          fieldName: 'purchasePurpose',
          rules: [{ required: true, message: '请选择 ', trigger: 'change' }],
          placeholder: '',
          itemList: this.createDictList('2127') || [],
        },
        {
          type: 'INPUT',
          label: '销售顾问',
          // disabled: true,
          rules: [],
          fieldName: 'consultantName',
          placeholder: '',
        },
        {
          type: 'INPUT_NUMBER',
          label: '购车价格',
          disabled: true,
          fieldName: 'orderAllAmount',
          rules: [],
          maxlength: 9,
          placeholder: '',
          numberFormat: true,
          precision: 0,
        },
        {
          type: 'DATE',
          label: '交车日期',
          disabled: true,
          maxDateTime: new Date(),
          format: 'yyyy-MM-dd HH:mm:ss',
          fieldName: 'handoverCarTime',
          dateType: 'exactdate',
          rules: [],
          placeholder: '',
        },
        {
          type: 'DATE',
          label: '订单创建日期',
          maxDateTime: new Date(),
          disabled: true,
          fieldName: 'snCreatedDate',
          dateType: 'exactdate',
          format: 'yyyy-MM-dd HH:mm:ss',
          placeholder: '',
        },
        {
          type: 'DATE',
          label: '终端开票日期',
          rules: [{ required: true, message: '请选择 ', trigger: 'change' }],
          maxDateTime: new Date(),
          fieldName: 'drawTime',
          dateType: 'exactdate',
          format: 'yyyy-MM-dd',
          placeholder: '',
        },
        {
          type: 'INPUT_NUMBER',
          min: 0,
          label: '开票金额',
          rules: [{ required: true, message: '请输入 ', trigger: 'change' }],
          fieldName: 'totalaMount',
          maxlength: 8,
          precision: 0,
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '发票号',
          rules: [{ required: true, message: '请输入 ', trigger: 'change' }],
          fieldName: 'invoiceNo',
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '特殊订单',
          fieldName: 'isSpecialOrder',
          rules: [],
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        {
          type: 'SELECT',
          label: '是否三包',
          fieldName: 'isThreeGuarantees',
          rules: [],
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        {
          type: 'SELECT',
          label: '是否异地购车',
          rules: [{ required: true, message: '请选择', trigger: 'change' }],
          fieldName: 'isAnotherPlace',
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        // {
        //   type: 'CHECKBOX',
        //   label: '是否试乘试驾车',
        //   // rules: [{ required: true, message: '请选择', trigger: 'blur' }],
        //   fieldName: 'isTestDriveCar',
        //   placeholder: '',
        //   initialValue: 10041001,
        //   options: {
        //     trueValue: 10041001,
        //     falseValue: 10041002
        //   },
        //   itemList: this.createDictList('1004') || []
        // },
        {
          type: 'INPUT_NUMBER',
          min: 0,
          label: '交车里程',
          maxlength: 8,
          precision: 0,
          rules: [{ required: true, message: '请输入', trigger: 'blur' }],
          fieldName: 'mileageUid',
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '是否建设电桩',
          fieldName: 'buildChargingPiles',
          rules: [],
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        {
          type: 'SELECT',
          label: '是否申报补贴',
          fieldName: 'isApplySubsidies',
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        {
          type: 'SELECT',
          label: '是否二次购买',
          fieldName: 'isBuyAgain',
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        {
          type: 'SELECT',
          label: '是否销量冲刺',
          fieldName: 'isSalesSprint',
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        {
          type: 'SELECT',
          label: '是否融资返利',
          fieldName: 'isRebate',
          placeholder: '',
          itemList: this.createDictList('1004') || [],
          change: (val) => {
            this.isSelectRebate(val);
          },
        },
        {
          type: 'SELECT',
          label: '是否增换购',
          fieldName: 'isReplace',
          placeholder: '',
          itemList: this.createDictList('1004') || [],
          change: (val) => {
            this.isSelectReplace(val);
          },
        },
        {
          type: 'SELECT',
          label: '是否电池租赁',
          // offsetRightCols: 2,
          rules: [],
          fieldName: 'isBatteryRental',
          placeholder: '',
          itemList: this.createDictList('1004') || [],
        },
        // {
        //   type: 'INPUT',
        //   label: '开票单位',
        //   rules: [{ required: true, message: '请选择 ', trigger: 'change' }],
        //   fieldName: 'invoiceUnit',
        //   placeholder: ''
        // },
        {
          type: 'SELECT',
          label: '车辆用途',
          fieldName: 'vehicleUse',
          disabled:true,
          // rules: [{ required: true, message: '请选择 ', trigger: 'change' }],
          placeholder: '',
          itemList: this.createDictList('2102') || [],
        },
        {
          type: 'SELECT',
          label: '是否分期',
          fieldName: 'typeOfPayment',
          // rules: [{ required: true, message: '请选择 ', trigger: 'change' }],
          placeholder: '',
          itemList: this.createDictList('2156') || [],
        },
        {
          type: 'SELECT',
          label: '交车方式',
          fieldName: 'handoverCarMethod',
          // rules: [{ required: true, message: '请选择 ', trigger: 'change' }],
          placeholder: '',
          itemList: this.createDictList('2155') || [],
        },
        {
          type: 'TEXT_AREA',
          label: '备注',
          offsetRightCols: 1,
          maxlength: 600,
          fieldName: 'remark',
          placeholder: '',
          selfCols: 3,
        },

        {
          type: 'UPLOAD_FILE',
          label: '发票附件',
          fieldName: 'invoiceUidList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '终端销售合同',
          selfCols: 2,
          fieldName: 'terminalSalesContract',
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '过程性合同',
          fieldName: 'proceduralContract',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '手持身份证照片',
          fieldName: 'holdIdentityCard',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '商业保险单',
          // disabled: true,
          fieldName: 'commercialInsuranceFiles',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '交强保险单',
          // disabled: true,
          fieldName: 'trafficlInsuranceFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '融资返利文件',
          // disabled: true,
          fieldName: 'rebateFiles',
          selfCols: 2,
          hidden: true,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf'],
            limit: 2,
            // tipText: '最多上传1个附件'
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '增换购附件',
          // disabled: true,
          fieldName: 'replaceFiles',
          selfCols: 2,
          hidden: true,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '其他附件',
          fieldName: 'attachmentUidsList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 10,
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
      ];
    },
    // ----------------------------上牌信息--------------------------
    createdFrom3() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '上牌信息',
        },
        {
          type: 'INPUT',
          label: '车牌号',
          // rules: [{ required: true, message: '请输入正确的车牌号', validator: ownerLicensePlate, trigger: 'blur' }],
          // rules: [
          //   { required: true, message: '请输入车牌号', trigger: ['blur', 'change'] },
          //   { min: 2, max: 8, message: '最长为8个字符', trigger: ['blur', 'change'] },
          // ],
          maxlength: 8,
          fieldName: 'licensePlateNumber',
          placeholder: '',
        },
        {
          type: 'DATE',
          label: '上牌日期',
          maxDateTime: new Date(),
          fieldName: 'licensePlateDate',
          dateType: 'exactdate',
          disabled: false,
          // rules: [{ required: true, message: '请选择', trigger: 'blur' }],
          placeholder: '',
        },
        {
          type: 'SELECT',
          label: '行驶证车辆性质',
          fieldName: 'licenseVehicleNature',
          // rules: [{ required: true, message: '请选择', trigger: 'change' }],
          placeholder: '',
          itemList: this.createDictList('2114'),
        },
        {
          type: 'SELECT',
          label: '上牌省份',
          fieldName: 'licensePlateProvinceCode',
          // rules: [{ required: true, message: '请选择', trigger: 'change' }],
          placeholder: '',
          initialValue: '',
          // itemList: this.createRegionsList()
          itemList: [],
          change: (val) => {
            this.licensePlateinitCity(val);
          },
        },
        {
          type: 'SELECT',
          label: '上牌城市',
          initialValue: '',
          // rules: [{ required: true, message: '请选择', trigger: 'change' }],
          fieldName: 'licensePlateCityCode',
          placeholder: '',
          itemList: [],
        },
        {
          type: 'INPUT',
          label: '行驶证号',
          maxlength: 36,
          fieldName: 'vehicleLicenseNumber',
          // rules: [
          //   { required: false, message: '请输入', trigger: 'blur' },
          //   // { required: false, message: '请输入正确的行驶证号', validator: licenseNum, trigger: 'blur' }
          // ],
          placeholder: '',
        },
        {
          type: 'DATE',
          label: '行驶证注册日期',
          maxDateTime: new Date(),
          fieldName: 'vehicleLicenseDate',
          disabled: false,
          // rules: [{ required: true, message: '请选择', trigger: 'blur' }],
          dateType: 'exactdate',
          placeholder: '',
        },
        {
          type: 'DATE',
          label: '行驶证发证日期',
          maxDateTime: new Date(),
          fieldName: 'vehicleLicenseIssueDate',
          // rules: [{ required: true, message: '请选择', trigger: 'blur' }],
          dateType: 'exactdate',
          placeholder: '',
        },
        // {
        //   type: 'INPUT',
        //   label: '行驶证档案编号',
        //   fieldName: 'vehicleLicenseFileNo',
        //   rules: [{ required: true, message: '请选择', trigger: 'blur' }],
        //   placeholder: '',
        //   disabled: false
        // },
        {
          type: 'INPUT',
          label: '行驶证住址',
          maxlength: 36,
          fieldName: 'vehicleLicenseAddress',
          // rules: [{ required: true, message: '请输入', trigger: 'blur' }],
          placeholder: '',
        },

        // {
        //   type: 'INPUT',
        //   label: '驾驶证号',
        //   maxlength: 36,
        //   rules: [{ min: 0, max: 20, message: '驾驶证号输入有误，请检查', trigger: 'blur' }],
        //   fieldName: 'drivingLicenseNumber',
        //   placeholder: ''
        // },

        {
          type: 'INPUT_NUMBER',
          label: '行驶里程',
          // precision: 0,
          maxlength: 8,
          fieldName: 'mileage',
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '行驶证所有人',
          rules: [],
          fieldName: 'vehiclePossessor',
          placeholder: '',
          disabled: true,
        },
        {
          type: 'TEXT_AREA',
          label: '备注',
          offsetRightCols: 1,
          maxlength: 600,
          fieldName: 'licenseRemark',
          placeholder: '',
          selfCols: 3,
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证正面',
          fieldName: 'vehicleLicenseFrontList',
          selfCols: 2,
          // rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            // fileTypes: ['jpg', 'png', 'bmp'],
            fileTypes: ['jpg'],
            fileSize: 0.5,
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证反面',
          selfCols: 2,
          fieldName: 'vehicleLicenseBackList',
          // rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证正面',
          selfCols: 2,
          fieldName: 'drivingLicenseFrontList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证反面',
          selfCols: 2,
          fieldName: 'drivingLicenseBackList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '其他附件',
          fieldName: 'otherFileUrlList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
          change: (val) => {
            this.changeUpload(val);
          },
        },
      ];
    },
    // // ----------------------------其他信息--------------------------
    // createdFrom4() {
    //   return [
    //     {
    //       type: 'BREAK_SPACE',
    //       label: '变更信息'
    //     },
    //     {
    //       type: 'TEXT_AREA',
    //       label: '变更说明',
    //       selfCols: 3,
    //       maxlength: 120,
    //       fieldName: 'alteration',
    //       placeholder: ''
    //     },
    //     {
    //       type: 'TEXT_AREA',
    //       label: '变更审批意见',
    //       fieldName: 'auditOpinion',
    //       disabled: true,
    //       maxlength: 120,
    //       placeholder: '',
    //       selfCols: 3
    //     }
    //   ];
    // },
    createdTable() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          fixed: 'left',
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        {
          title: '变更字段类型',
          dataIndex: 'auditName',
          sorter: true,
          filter: true,
          filterType: 'input',
        },
        {
          title: '变更前',
          dataIndex: 'auditBefore',
          sorter: true,
          filter: true,
          filterType: 'input',
          render: (props) => <span>{props.row.value2}</span>,
        },
        {
          title: '变更后',
          dataIndex: 'auditAfter',
          sorter: true,
          filter: true,
          filterType: 'input',
          render: (props) => <span>{props.row.value3}</span>,
        },
        {
          title: '变更时间',
          dataIndex: 'createdAt',
          sorter: true,
          filter: true,
          filterType: 'input',
          dateFormat: 'yyyy-MM-dd HH:mm:ss',
        },
        {
          title: '变更人',
          dataIndex: 'createdBy',
          sorter: true,
          filter: true,
          filterType: 'input',
        },
      ];
    },
    createdFrom5() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '变更前',
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证正面',
          billType: 11121006,
          disabled: true,
          hidden: true,
          fieldName: 'identityCardFront',
          selfCols: 2,
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证反面',
          disabled: true,
          hidden: true,
          billType: 11121007,
          selfCols: 2,
          fieldName: 'identityCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121008,
          disabled: true,
          hidden: true,
          label: '法人身份证正面',
          selfCols: 2,
          fieldName: 'legalIdentityCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121009,
          disabled: true,
          hidden: true,
          label: '法人身份证反面',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          fieldName: 'legalIdentityCardReverse',
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '营业执照',
          billType: 11121010,
          disabled: true,
          hidden: true,
          fieldName: 'businessLicense',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '管理员授权文件',
          billType: 11121016,
          disabled: true,
          hidden: true,
          fieldName: 'adminAuthorizationFiles',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证正面',
          billType: 11121017,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证反面',
          billType: 11121018,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '大客户附件',
          billType: 11121011,
          disabled: true,
          hidden: true,
          fieldName: 'bigCustomerFiles',
          hidden: true,
          rules: [{ required: false, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '发票附件',
          disabled: true,
          hidden: true,
          billType: 11121001,
          fieldName: 'invoiceUidList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '终端销售合同',
          selfCols: 2,
          disabled: true,
          hidden: true,
          billType: 11121004,
          fieldName: 'terminalSalesContract',
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '过程性合同',
          billType: 11121005,
          fieldName: 'proceduralContract',
          selfCols: 2,
          disabled: true,
          hidden: true,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '手持身份证照片',
          billType: 11121002,
          disabled: true,
          hidden: true,
          fieldName: 'holdIdentityCard',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '商业保险单',
          disabled: true,
          hidden: true,
          disabled: true,
          billType: 11121014,
          fieldName: 'commercialInsuranceFiles',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '交强保险单',
          disabled: true,
          hidden: true,
          disabled: true,
          billType: 11121015,
          fieldName: 'trafficlInsuranceFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '融资返利文件',
          billType: 11121012,
          // disabled: true,
          fieldName: 'rebateFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf'],
            limit: 2,
            // tipText: '最多上传1个附件'
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '增换购附件',
          disabled: true,
          // disabled: true,
          fieldName: 'replaceFiles',
          selfCols: 2,
          billType: 11121014,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证正面',
          disabled: true,
          hidden: true,
          billType: 21121001,
          fieldName: 'vehicleLicenseFrontList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证反面',
          billType: 21121002,

          disabled: true,
          hidden: true,
          selfCols: 2,
          fieldName: 'vehicleLicenseBackList',
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证正面',
          disabled: true,
          hidden: true,
          selfCols: 2,
          billType: 21121003,
          fieldName: 'drivingLicenseFrontList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证反面',
          disabled: true,
          hidden: true,
          billType: 21121004,
          selfCols: 2,
          fieldName: 'drivingLicenseBackList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '上牌信息其他附件',
          disabled: true,
          hidden: true,
          billType: 21121005,
          fieldName: 'otherFileUrlList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '销售信息其他附件',
          disabled: true,
          hidden: true,
          billType: 11121003,
          fieldName: 'attachmentUidsList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 10,
          },
        },
      ];
    },
    createdFrom6() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '变更后',
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证正面',
          billType: 11121006,
          disabled: true,
          hidden: true,
          fieldName: 'identityCardFront',
          selfCols: 2,
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证反面',
          disabled: true,
          hidden: true,
          billType: 11121007,
          selfCols: 2,
          fieldName: 'identityCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121008,
          disabled: true,
          hidden: true,
          label: '法人身份证正面',
          selfCols: 2,
          fieldName: 'legalIdentityCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121009,
          disabled: true,
          hidden: true,
          label: '法人身份证反面',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          fieldName: 'legalIdentityCardReverse',
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '营业执照',
          billType: 11121010,
          disabled: true,
          hidden: true,
          fieldName: 'businessLicense',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '管理员授权文件',
          billType: 11121016,
          disabled: true,
          hidden: true,
          fieldName: 'adminAuthorizationFiles',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证正面',
          billType: 11121017,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证反面',
          billType: 11121018,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '大客户附件',
          billType: 11121011,
          disabled: true,
          hidden: true,
          fieldName: 'bigCustomerFiles',
          hidden: true,
          rules: [{ required: false, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '发票附件',
          disabled: true,
          hidden: true,
          billType: 11121001,
          fieldName: 'invoiceUidList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '终端销售合同',
          selfCols: 2,
          disabled: true,
          hidden: true,
          billType: 11121004,
          fieldName: 'terminalSalesContract',
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '过程性合同',
          billType: 11121005,
          fieldName: 'proceduralContract',
          selfCols: 2,
          disabled: true,
          hidden: true,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '手持身份证照片',
          billType: 11121002,
          disabled: true,
          hidden: true,
          fieldName: 'holdIdentityCard',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '商业保险单',
          disabled: true,
          hidden: true,
          disabled: true,
          billType: 11121014,
          fieldName: 'commercialInsuranceFiles',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '交强保险单',
          disabled: true,
          hidden: true,
          disabled: true,
          billType: 11121015,
          fieldName: 'trafficlInsuranceFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '融资返利文件',
          billType: 11121012,
          // disabled: true,
          fieldName: 'rebateFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf'],
            limit: 2,
            // tipText: '最多上传1个附件'
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '增换购附件',
          disabled: true,
          billType: 11121013,
          // disabled: true,
          fieldName: 'replaceFiles',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证正面',
          disabled: true,
          hidden: true,
          billType: 21121001,
          fieldName: 'vehicleLicenseFrontList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证反面',
          billType: 21121002,
          disabled: true,
          hidden: true,
          selfCols: 2,
          fieldName: 'vehicleLicenseBackList',
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证正面',
          disabled: true,
          hidden: true,
          selfCols: 2,
          billType: 21121003,
          fieldName: 'drivingLicenseFrontList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证反面',
          disabled: true,
          hidden: true,
          billType: 21121004,
          selfCols: 2,
          fieldName: 'drivingLicenseBackList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '上牌信息其他附件',
          disabled: true,
          hidden: true,
          billType: 21121005,
          fieldName: 'otherFileUrlList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '销售信息其他附件',
          disabled: true,
          hidden: true,
          billType: 11121003,
          fieldName: 'attachmentUidsList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 10,
          },
        },
      ];
    },
    createdFrom7() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '电池租赁',
        },
        {
          type: 'INPUT',
          label: '协议签订',
          disabled: true,
          fieldName: 'statusName',
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '签订类型',
          disabled: true,
          fieldName: 'contractTypeName',
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '保证金缴纳状态',
          disabled: true,
          fieldName: 'depositOrderStatusName',
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '租金缴纳',
          disabled: true,
          fieldName: 'firstRentOrderStatusName',
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '月租金',
          disabled: true,
          fieldName: 'rentAmount',
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '租金类型',
          disabled: true,
          fieldName: 'rentTypeName',
          placeholder: '',
        },
        {
          type: 'INPUT',
          label: '租金名称',
          disabled: true,
          fieldName: 'rentName',
          placeholder: '',
        },
        {
          type: 'DATE',
          label: '协议签订日期',
          maxDateTime: new Date(),
          fieldName: 'signTime',
          dateType: 'exactdate',
          format: 'yyyy-MM-dd HH:mm:ss',
          placeholder: '',
          disabled: true,
        },
      ];
    },
  },
};
</script>

<style lang="scss">
.detailed div [type='UN_FIXED'] {
  min-height: 150px !important;
}
</style>
